<template>
  <div class="">
    Son
    <p>
      {{ money }}
    </p>
    <button @click="send">传值给爷爷</button>
  </div>
</template>

<script setup>
import { inject } from 'vue'
// inject 接收传递过来的值
const money = inject('money')
// console.log('---money---', money)

const getValue = inject('getValue')
// console.log('---getValue---', getValue)

const send = () => {
  //   console.log('---send---')
  //   console.log(getValue)
  getValue('你是一个好爷爷')
}
</script>

<style scoped></style>
